< previous page page_292 next page >

Page 292
2. Set the text box's properties as follows:
d6ef40187df115e88326dbc94f09ab9a.gif
Set the Name property to txtArray (or any other valid name).
d6ef40187df115e88326dbc94f09ab9a.gif
Clear the Text property.
d6ef40187df115e88326dbc94f09ab9a.gif
Set the Font property to Courier New, 10 point.
d6ef40187df115e88326dbc94f09ab9a.gif
Note that the Index property is empty (has no value).
3. Click the text box to ensure that it is still selected, and press Ctrl+C or choose Copy from the Edit menu to copy it to the Clipboard.
4. Click the form to make sure it (and not the Properties window, for example) is the active window. Press Ctrl+V, or choose Paste from the Edit menu to place a copy of the text box on the form.
5. At this point, a dialog box asks you to confirm that it is your intention to create a control array (see Figure 13.2). Choose Yes to create a control array.
0292-01.jpg
Figure 13.2
The easiest way to create a control array
is to copy and paste an existing control.
Look at the properties of the new (pasted) control. The Properties window shows that you are setting properties for txtArray(1), which specifically refers to the new element of the control array that is currently selected. Notice that its Font and Text properties match those of the text box that was copied. Notice also that the new control's Index property is set to 1.
6. Drag the new text box to a position directly below the original.
7. Click the original text box to select it. Notice that its Index property has changed from having no value to a value of 0.
8. The text box that you copied in step 3 is still on the Clipboard, so you don't need to copy it again. Paste another copy of the text box onto the form, and drag it to a position below the other two.
Note that the new control's relevant properties match the others, and that its Index property is 2. As each control is added to the control array, its Index property is assigned a value that is one greater than the Index of the previous element. The indexes of a control array start at 0.
note.gif You don't see the control array confirmation box again, as it appears only when you attempt to make the first copy of the control. square.gif

9. Add a fourth TextBox control in the same manner, drag it to a position below the others, and set its Width property to 495 twips.

 
< previous page page_292 next page >